﻿@using RazorEngine.Templating
@using codeGen.Model;
@using System.Globalization;
@* @inherits TemplateBase<ClassMetadata>; *@


@{
    
    TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;
    string className = char.ToLower(Model.ClassName[0]) + Model.ClassName.Substring(1);
    string interfaceName = "I" + Model.ClassName + "Service";
    string interfaceVerb = "_" + className + "Service";
    string tempinterfaceVerb = className + "Service";
}
using Lord.Platform.Domain.Share;
using Lord.Platform.Service;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Test
{
    /// <summary>
    /// @Model.ClassComment
    ///</summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class @(Model.ClassName + "Controller") : ControllerBase
    {
        private readonly @interfaceName @interfaceVerb;
        public  @(Model.ClassName + "Controller")(@interfaceName @tempinterfaceVerb)
        {
            @interfaceVerb = @tempinterfaceVerb;
        }
        @{
        @:/// <summary>
        @:/// @Model.ClassComment 删除
        @:/// </summary>
        @:[HttpPost]
        @:public  Task<RspResult<bool>> Del(List<long> ids)
        @:{
        @:   return @(interfaceVerb).Del(ids);
        @:}
        @:/// <summary>
        @:/// @Model.ClassComment 获取model
        @:/// </summary>
        @:[HttpGet]
        @:public Task<RspResult<ViewPlotInfo>> GetModel(long id)
        @:{
        @:    return @(interfaceVerb).GetModel(id);
        @:}
        @:/// <summary>
        @:/// @Model.ClassComment 获取分页信息
        @:/// </summary>
        @:[HttpGet]
        @:public Task<RspResult<DataPager<ViewPlotInfo>>> GetPage()
        @:{
        @:    return @(interfaceVerb).GetPage();
        @:}
        @:/// <summary>
        @:/// @Model.ClassComment 添加/编辑
        @:/// </summary>
        @:[HttpPost]
        @:public Task<RspResult<bool>> Edit(ViewPlotInfo model)
        @:{
        @:    return @(interfaceVerb).Edit(model);
        @:}
        }
    }
}
